using System;
using System.BusinessObjects.Data;
using Iesi.Collections.Generic;

namespace Blazing.BusinessObjects.Tagging
{
    [Serializable]
    public class Taxonomy : DataObject<Taxonomy>
    {
        #region Properties
        public virtual int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        public virtual string Name
        {
            get { return GetValue<string>("Name"); }
            set
            {
                BeginEdit();
                SetValue("Name", value);
            }
        }

        public virtual string Slug
        {
            get { return GetValue<string>("Slug"); }
            set
            {
                BeginEdit();
                SetValue("Slug", value);
            }
        }

        public virtual TaxonomyType TaxonomyType 
        { 
            get; 
            set; 
        }

        private ISet<TaxonomyTag> _taxonomyTags = new HashedSet<TaxonomyTag>();
        public virtual ISet<TaxonomyTag> TaxonomyTags
        {
            get { 
                return _taxonomyTags; }
            set
            {
                BeginEdit();
                _taxonomyTags = value;
            }
        }

        public virtual DateTime RowStamp
        {
            get { return GetValue<DateTime>("RowStamp"); }
            set
            {
                SetValue("RowStamp", value);
            }
        }       

        #endregion
    }
}
